<%--
  Created by IntelliJ IDEA.
  User: zzz
  Date: 2020/2/11
  Time: 19:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8" />
    <title>个人信息</title>
    <link rel="stylesheet" type="text/css" href="${APP_PATH}/portal/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="${APP_PATH}/portal/css/mygrxx.css" />
</head>
<body>
<!------------------------------head------------------------------>
<jsp:include page="/WEB-INF/jsps/Portal/common/top.jsp"/>
<!------------------------------idea------------------------------>
<div class="address">
    <div class="wrapper clearfix">
        <a href="${APP_PATH}/toPortal" class="fl">首页</a>
        <span>/</span>
        <a href="${APP_PATH}/toUpdatePass" class="on">个人信息</a>
    </div>
</div>

<!------------------------------Bott------------------------------>
<div class="Bott">
    <div class="wrapper clearfix">
        <jsp:include page="/WEB-INF/jsps/Portal/common/nav.jsp"/>
        <div class="you fl">
            <h2>修改密码</h2>
            <form action="${APP_PATH}/user/updatePass" method="post" class="remima">
                <input type="hidden" name="uid" value="${sessionScope.user.uid}">
                <p><span>原密码：</span><input id="oldPass" type="text" /></p>
                <p><span>新密码：</span><input id="newPass" type="text" name="upass"/></p>
                <p><span>重复新密码：</span><input id="newPass2" type="text" /></p>
                <input type="submit" onclick="return update()" value="提交" />
            </form>
        </div>
    </div>
</div>

<!--返回顶部-->
<jsp:include page="/WEB-INF/jsps/Portal/common/gotop.jsp"/>
<!--footer-->
<jsp:include page="/WEB-INF/jsps/Portal/common/bottom.jsp"/>
<script src="${APP_PATH}/portal/js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="${APP_PATH}/portal/js/public.js" type="text/javascript" charset="utf-8"></script>
<script src="${APP_PATH}/portal/js/user.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<script>
    function update() {
        var flag = true;
        var oldPass = $("#oldPass").val();
        var newPass = $("#newPass").val();
        var newPass2 = $("#newPass2").val();
        if(oldPass != '${sessionScope.user.upass}'){
            flag = false;
            alert("原密码错误！");
        }
        if(newPass != newPass2){
            flag = false;
            alert("两次密码不一致！");
        }
        return flag;
    }
</script>
